/*
1.枚举定义日志等级
2.显示等级错误


*/
#ifndef __M_LOGS_H_
#define __M_LOGS_H_

#include <iostream>
#include <string>

// 报错等级类，该类的实现就是把所有等级枚举出来，然后再用函数处理返回字符串

namespace TopLog
{
    class Logs
    {
    public:
        enum struct Value
        {
            UNKNOWNS = 0,
            DEBUG,
            INFO,
            WARNING,
            ERROR,
            FATAL,
            OFF
        };

        static const char *Tostring(TopLog::Logs::Value vl) // 返回日志
        {
            switch (vl)
            {
            case TopLog::Logs::Value::UNKNOWNS:
                return "UNKNOWNS";

            case TopLog::Logs::Value::DEBUG:
                return "DEBUG";
            case TopLog::Logs::Value::INFO:
                return "INFO";
            case TopLog::Logs::Value::WARNING:
                return "WARNING";
            case TopLog::Logs::Value::ERROR:
                return "ERROR";
            case TopLog::Logs::Value::FATAL:
                return "FATAL";
            case TopLog::Logs::Value::OFF:
                return "OFF";
            }
            return "OFF";
        }
    };
}

#endif